From f4574ef6add948a18b7ef0b1bb797256a0301e19 Mon Sep 17 00:00:00 2001 From: "cl349@freefall.cl.cam.ac.uk" Date: Wed, 21 Jul 2004 09:56:10 +0000 Subject: [PATCH] bitkeeper revision 1.1108.2.12 (40fe3dbaxIWEKBVXUkHDWE0aDdMw5w) Fix the Xen specific idle loop for good. --- .../arch/xen/i386/kernel/time.c | 39 ++++++++----------- .../arch/xen/kernel/process.c | 6 ++- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/time.c index c6fa43f378..f342466a8b 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/time.c +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/time.c @@ -474,28 +474,23 @@ static inline u64 __jiffies_to_st(unsigned long j) * * It must be called with interrupts disabled. */ -extern spinlock_t timerlist_lock; int set_timeout_timer(void) { - u64 alarm = 0; - int ret = 0; - int cpu = smp_processor_id(); - - spin_lock(&timerlist_lock); - - /* - * This is safe against long blocking (since calculations are not based on - * TSC deltas). It is also safe against warped system time since - * suspend-resume is cooperative and we would first get locked out. It is - * safe against normal updates of jiffies since interrupts are off. - */ - alarm = __jiffies_to_st(next_timer_interrupt()); - - /* Failure is pretty bad, but we'd best soldier on. */ - if ( HYPERVISOR_set_timer_op(alarm) != 0 ) - ret = -1; - - spin_unlock(&timerlist_lock); - - return ret; + u64 alarm = 0; + int ret = 0; + + /* + * This is safe against long blocking (since calculations are + * not based on TSC deltas). It is also safe against warped + * system time since suspend-resume is cooperative and we + * would first get locked out. It is safe against normal + * updates of jiffies since interrupts are off. + */ + alarm = __jiffies_to_st(next_timer_interrupt()); + + /* Failure is pretty bad, but we'd best soldier on. */ + if ( HYPERVISOR_set_timer_op(alarm) != 0 ) + ret = -1; + + return ret; } diff --git a/linux-2.6.7-xen-sparse/arch/xen/kernel/process.c b/linux-2.6.7-xen-sparse/arch/xen/kernel/process.c index a9282773d6..f01dc9b8ec 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/kernel/process.c +++ b/linux-2.6.7-xen-sparse/arch/xen/kernel/process.c @@ -6,12 +6,16 @@ #include #include #include +#include +extern int set_timeout_timer(void); void xen_cpu_idle (void) { + int cpu = smp_processor_id(); + local_irq_disable(); - if (need_resched() || !list_empty(&RCU_curlist(cpu))) + if (need_resched() || !list_empty(&RCU_curlist(cpu))) { local_irq_enable(); return; } -- 2.30.2